﻿using System;
using System.Collections.Generic;
using ShopB2C.Entity;
using ShopB2C.Enums;
using ShopB2C.ViewModels;

namespace ShopB2C.Interfaces {
    /// <summary>
    /// 商品接口
    /// </summary>
    public interface IProductPreview {
        /// <summary>
        /// 商品搜索
        /// </summary>
        /// <param name="psc">商品搜索条件传递类</param>
        /// <param name="pageCount">页数</param>
        /// <returns>List</returns>
        List<ProductEntity> Search(ProductSearchCondition psc, out int pageCount);
        /// <summary>
        /// 商品搜索
        /// </summary>
        /// <param name="psc">商品搜索条件传递类</param>
        /// <param name="pageCount">页数</param>
        /// <param name="rowsCount">总记录数</param>
        /// <returns>List</returns>
        List<ProductEntity> Search(ProductSearchCondition psc, out int pageCount, out int rowsCount);
        /// <summary>
        /// 商品批量修改(统一)
        /// </summary>
        /// <param name="productIds">商品 id 集</param>
        /// <param name="actions">操作集, ProductBatchActionType 枚举</param>
        /// <param name="stock">库存数</param>
        /// <param name="discount">折扣</param>
        /// <param name="sales">上架时间</param>
        /// <param name="status">商品状态</param>
        /// <param name="brandId">品牌 id</param>
        /// <returns>1 表示成功</returns>
        int Batch(string productIds, string actions, int stock, float discount,
            DateTime sales, ProductStatus status, int brandId);
        /// <summary>
        /// 商品批量修改(逐个)
        /// </summary>
        /// <param name="productIds">商品 id 集</param>
        /// <param name="stocks">库存集</param>
        /// <param name="discounts">折扣集</param>
        /// <param name="sales">上架时间集</param>
        /// <param name="status">商品状态集</param>
        /// <param name="brands">品牌 id 集</param>
        /// <param name="actives">是否激活集</param>
        /// <returns></returns>
        int Batch(string productIds, string stocks, string discounts, string sales,
            string status, string brands, string actives);
        /// <summary>
        /// 获取指定商品 id 集列表
        /// </summary>
        /// <param name="productIds">商品的 id 集, (1,2,3)</param>
        /// <returns>商品列表</returns>
        List<ProductEntity> GetProductByIds(string productIds);
        /// <summary>
        /// 获取商品的属性列表
        /// </summary>
        /// <param name="productId">关联的商品ID</param>
        /// <returns>属性列表</returns>
        List<ProductPropertyEntity> PropertyList(int productId,int? classId);
        /// <summary>
        /// 获取商品图片扩展列表
        /// </summary>
        /// <param name="para">关联的商品ID</param>
        /// <returns>关联的商品图片列表 </returns>
        List<ProductImageEntity> GetImageList(int productId);
        /// <summary>
        /// 商品预览
        /// </summary>
        /// <param name="productId">关联的商品ID</param>
        /// <param name="uid">用户ID，作为打折信息用</param>
        /// <returns>商品实体</returns>
        ProductEntity ProductView(int productId, int uid);
        /// <summary>
        /// 获取商品详细信息
        /// </summary>
        /// <param name="productId">关联的商品ID</param>
        ProductDetailsEntity GetDetails(int productId);
        /// <summary>
        /// 扩展的高级属性
        /// </summary>
        /// <param name="productId">关联的商品ID</param>
        /// <returns>返回的高级扩展</returns>
        List<ProductExtendEntity> ProductExtendList(int productId);
        /// <summary>
        /// 会员组打折
        /// </summary>
        /// <param name="productId">关联的商品ID</param>
        /// <returns>折扣表</returns>
        List<UserLevelEntity> MemberDiscount(int productId);
        /// <summary>
        /// 用来筛选的商品属性
        /// </summary>
        /// <param name="classId">关联的商品列表</param>
        List<ProductPropertyEntity> PropertyFilter(int classId);
        /// <summary>
        /// 获取部件列表
        /// </summary>
        /// <returns>部件列表</returns>
        List<ProductPartEntity> GetPartList(bool? isValid);
        /// <summary>
        /// 获取指定部件内容
        /// </summary>
        /// <param name="partId">关联的部件ID</param>
        /// <returns>包含部件内容和产品列表</returns>
        ProductPartEntity GetProductPart(int partId, bool? isValid);
        /// <summary>
        /// 获取相关产品
        /// </summary>
        /// <param name="ProductId">关联的产品ID</param>
        /// <returns>产品列表</returns>
        ProductPartEntity RelateList(int ProductI);
        /// <summary>
        /// 
        /// </summary>
        /// <param name="productId"></param>
        /// <param name="modelKey"></param>
        /// <returns></returns>
        ProductPartEntity SameProduct(int productId , ProductPart modelKey);
    }
}
